// dlg.txt

//MK Edit

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 28;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You approach the lower tower of Hraxamus. This was once a mighty stone fortress of the Rokaj. Then it was shattered by an enormous force, probably delivered by Haven. It has been abandoned for a century.";
	text2 = "At least, it's been abandoned by the living. The moment you set foot inside the outer wall, you hear whispering. Quiet at first, full of rage. Then slowly louder.";
	text3 = "Your arrival has awakened something here. Something that really, really doesn't like you.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "You enter the lower tower. It is an icy cold ruin. Nobody has been here for years. Nobody living, anyway.";
	text2 = "There are bones and torn bits of armor everywhere. You see dented helmets and slivers of shattered weapons. All of the torn clothing and broken blades are of the Ro style. Haven delivered the Rokaj a devastating defeat here.";
	text3 = "When you enter the tower, the whispering suddenly ceases. The ghosts are still all around you, but now they are watching. Waiting.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "You approach the ruins of the upper tower of Hraxamus. It was once an imposing fortress. Then Haven shattered it as part of putting down the Great Uprising.";
	text2 = "The ruin is not unoccupied. A nearby sign says that there's an arena ahead. A place for all to test their strength. Interesting.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "There is a camp outside the ruined tower. You see a mix of Rokaj warriors. Some came to the arena to fight. Others came with captured beasts, brought here to be fought for sport.";
	text2 = "You are painfully unwelcome. They sit, eat, sneer, and pretend that you aren't here.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "Through the gate, you can see the arena. It was a courtyard of the tower. Then it was scattered with dirt and straw. Warriors use it to test their strength against beasts and, occasionally, each other. You see a few pools of blood that haven't been covered yet.";
	text2 = "During a battle, the Rokaj watch through the gates. They cheer, shout advice, and occasionally place a bet. This is a marvelous chance to show the strength of the Ro.";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0 && gf(28,21) > 0 && gf(28,22) > 0;
	text1 = "Now that both gates are open, you have revealed a new hidden path between the High Litha and the Kranas Woods. Smugglers and raiders are sure to be grateful for your efforts.";
	text2 = "(Opening gates between provinces makes traveling using the World Map slightly faster.)";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = gf(28,13) > 0 && gf(28,10) == 0;
	text1 = "To the west, you see a final ghost. It was the robed shade that whispered to the Lithan ghost that attacked you. When you enter the hall, it points at you.";
	text2 = "_In life, I was a hero of the Rokaj! I was one of those who set the Great Uprising ablaze! When you die in our halls, I will inspire my people to rebellion once again. You have made your final mistake!_";
	text3 = "As it speaks, more skeletons reform on the other side of the gates.";
	code =
	sf(28,10,1);
		activate_hidden_group(3);
	break;
	
begintalknode;
	tag = 14;
	condition = 1;
	text1 = "Your blows easily tear apart the ghostly rebel. It doesn't even have time to make another deluded speech. It just sort of falls apart.";
	text2 = "The power animating its guards leaks away. The bones fall apart. The whispering finally ceases. At last, the rebels here can rest. Failures forever.";
	
begintalknode;
	tag = 15;
	condition = 1;
	text1 = "And, just like that, the Pitmaster of the Rokaj is dead at your feet. A worthy foe, but no match for the might of Haven.";
	text2 = "You look around to see the reaction of the Ro warriors. There is no cheering, no cries for vengeance. They are packing up. Now that the Pitmaster is dead, there is no point in remaining. Tales of your fearsome brutality will soon spread through the Rokaj.";
	text3 = "Soon, the ruins will be empty. Surely, when times are calm again, a new Pitmaster will come and restart the games. Right now, it is clear to the warriors that they need to return home and prepare for whatever is coming.";
	code =
		set_dialogue_pic(840);
	break;

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "The battle is done. Surprisingly, the Ro cheer. They don't like you. They don't like that you are fighting here. However, they have to acknowledge your bravery.";
	text2 = "The gates open. Workers come in to cover the stains with fresh straw. You can poke around and claim any trophies you find.";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "The warriors engage in basic Ro hospitality. When you approach, they allow you to sit with them and share their meal. However, they don't speak with you.";
	text2 = "They are far more impressed with you than they were when you first arrived. You have proved that you can fight. That is the most important currency here.";
	text3 = "Perhaps they will be more polite if you prove that you are worthy in battle. You know that you are, but they haven't seen it.";
	text4 = "Now that the Pitmaster is dead, this warrior is preparing to leave. None of them will meet your gaze. They have seen the full power of Haven, and they are experiencing something new: fear.";
	code =
		cs();
		as(1);
		if (gf(28,12) > 0)
			as(4);
		else if (gf(28,15) == 0)
			as(3);
			else rs(2);
	break;
	
begintalknode;
	tag = 18;
	condition = 1;
	text1 = "The ghost warrior stares at you with loathing. However, it is too weak and insubstantial to do more than give you angry looks. And the occasional obscene hand gesture.";
	code =
		set_dialogue_pic(853); // 
	break;

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "The stairway ends at an impassable pile of rubble.";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "Several beasts have been brought here to fight in the arena. They are securely chained up, but they try to lunge at you when you get close.";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "The warriors gather at the gates. Everyone outside rushes indoors to see the spectacle. They watch you analytically, eager to see the battle technique of the [P] of Haven.";
	text2 = "There is a long hush. Then one of the gates opens, and your opponent rushes into the arena.";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "Once again, you take your place in the arena. The Ro warriors gather to watch. There is a long silence. For a moment, you think you will be spared a battle. Then the gate behind you opens. Pitmaster Grenich, fully armed and armored, enters and takes his place. The gate closes.";
	text2 = "He fights alone.";
	text3 = "This historic duel between Haven and the Rokaj, between Empire and Deep Truth, begins.";
	code =
		set_dialogue_pic(840);
	break;

begintalknode;
	tag = 23;
	condition = 1;
	text1 = "You are victorious. The beasts are dead. The gate they emerged from remains open. The exit gate opens as well.";
	text2 = "The Ro warriors grant you polite applause. Then they walk off to excitedly discuss what they learned watching you fight. News of your victory will soon spread.";

begintalknode;
	tag = 24;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 25;
	condition = 1;
	text1 = "__";

//// Grenich

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "This warrior looks to be in his thirties, and his body bears the signs of many battles. Lots of scars. A bent leg. Some joints set at weird angles. He is sitting at his desk keeping records of the battles here. It's not a natural job for him.";
	text2 = "When you approach, he rises and looks you up and down. _Never met a [P] before. I am Pitmaster Grenich._ You note that he does not bow. All of the warriors and spectators watch and listen intently.";
	text3 = "_This is a place of honor and testing. All come to prove their worth by the standards of the Rokaj. You are allowed to be here, but not welcome._";
	text5 = "Pitmaster Grenich sits at his table and writes accounts of the many battles that take place here. Some are duels of honor. Some are battles with beasts. You can speak with him, but he won't talk to you unless he is forced.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_What is this place?_";
	text1 = "He looks up at you, calmly meeting your gaze. _These are the ruins of Hraxamus, where many noble rebels of the Great Uprising were sent to their final rest. Now warriors come here from all over the Ro to fight and prove their skill in honor of the lost._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_What sort of prizes are won here?_";
	text1 = "_Oh, there are bounties. Each beast fought here comes with a bounty, taken from those that fail. However, the greatest reward is honor._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Who comes to fight?_";
	text1 = "_All of the most ambitious warriors of the Rokaj. Most are content to hunt, to raid. There is no dishonor in it. But those who wish to rise, to win rank, to be remembered? This is where they prove themselves._";

begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_What is fought here?_";
	text1 = "_Some come to fight duels, but most come to battle beasts. Some subdue our beasts. Some kill them. Many end up food for our menagerie._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Where do you get your beasts?_";
	text1 = "_Our hunters bring them. The Rokaj has no shortage of wild and deadly beasts._";
	text2 = "_For the hunters of our land, bringing mighty prey alive to this tower is itself a source of great honor._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "_I need a place to rest and trade._";
	text1 = "_You can rest on the beds in the corner._ He points at the three filthy, beaten-down bunks to the south. _This is not a shop. The only currency accepted here is blood._";

begintalknode;
	state = 10;
	nextstate = 13;
	condition = 1;
	question = "_How did you come to be Pitmaster?_";
	text1 = "_I wanted the position, and I proved my worth._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_What proved your worth?_";
	text1 = "_Many battles. In the hunt. In war. I am one of the finest warriors in our land._ His tone of voice lets you know that he considers himself comfortably superior to you.";

begintalknode;
	state = 10;
	nextstate = 14;
	condition = gf(28,14) == 0;
	question = "_I would like to fight._";
	text1 = "There is a general grumble of discontent. Grenich looks like he is sucking on a lemon. _This is a place of the Ro, Haven. Surely you have appropriate prey upward or downward? This game is not for you._";
	
begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_All right. Never mind._";
	text1 = "_Then watch a fight or not. Rest if you need to. Then leave me to my work._";
	action = END_TALK;
	
begintalknode;
	state = 14;
	nextstate = 10;
	condition = 1;
	question = "_You said that all comers can prove their worth. Here I am._";
	text1 = "The warriors are quite unhappy. The Pitmaster lets out a long sigh. You are right, and all know it. _Then yes, you may enter the pit. Know this, though. When you fail, your precious royal bones will rest here. It is on your head._";
	code =
		sf(28,14,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(28,14) == 1 && gf(28,19) == 0 && gf(28,15) == 0;
	question = "_I am ready to fight._";
	text1 = "_I don't want the blood of royalty on my conscience. I will start you out with some of our older beasts. Enter the pit and stand near the center. Do not call to us for mercy. Victory is your only escape._";
	code =
		sf(28,24,1);
		sf(28,19,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(28,14) == 1 && gf(28,15) > 0;
	question = "_I have completed the first challenge._";
	text1 = "_Yes. The prey was old and weak, but you fought well. You can find your bounty in its cell._";
	text2 = "_You have proved yourself. The Ro will hear of your courage. You can leave any time now._";
	code =
		ro_faction(1);
		sf(28,14,2);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(28,14) == 2 && gf(28,19) == 0 && gf(28,16) == 0;
	question = "_I want another fight._";
	text1 = "The Pitmaster doesn't want this. However, the warriors are curious about your strength. Grenich notes this. _Fine. You are a [P]. You deserve this gift from your loyal vassals. Enter the pit when you are ready._";
	code =
		sf(28,24,1);
		sf(28,19,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(28,14) == 2 && gf(28,16) > 0;
	question = "_I have completed your second challenge._";
	text1 = "_It was well-fought, I must admit. You may claim your bounty. I hope you have satisfied your hunger for glory enough. Leave your vassals to their traditions._";
	code =
		ro_faction(1);
		sf(28,14,3);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(28,14) == 3 && gf(28,19) == 0 && gf(28,17) == 0;
	question = "_I want another fight._";
	text1 = "Pitmaster Grenich looks annoyed. _You squander the power of your Empire on our little arena. You rob us of all of our prey. Still, you are the [P], and arrogance is your right. Enter the arena if you wish._";
	code =
		sf(28,24,1);
		sf(28,19,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(28,14) == 3 && gf(28,17) > 0;
	question = "_I have killed your third pest._";
	text1 = "_The Rokaj will hear of it. It was an impressive fight. It will make for quite a tale. You have proved your courage._";
	text2 = "_However, we are now out of beasts. You have closed our arena for a time. I hope you are satisfied with your rewards._";
	code =
		ro_faction(1);
		sf(28,14,4);
	break;
	
begintalknode;
	state = 10;
	nextstate = 15;
	condition = gf(28,14) == 4 && gf(28,19) == 0;
	question = "_I still want to fight._";
	text1 = "_I already told you. We are out of beasts. It will take time to restock them, though it will be quite an amusement for the hunters of the Kranas._";
	text2 = "_We have no animals to fight._ He is starting to look slightly nervous.";
	
begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_Then I will be content._";
	text1 = "_I admit, your visit was fascinating. Expensive, but instructive. We wish you safe travels and just decisions._";
	action = END_TALK;
	
begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_I still haven't fought you._";
	text1 = "There is a long, intense silence. Pitmaster Grenich looks you in the eye. You meet his gaze. You can't imagine what he is thinking, what happened in his life to make him who he is and bring him to this place.";
	text2 = "You will never understand what possesses him to say, _All right. I will fight you._ He must hate you, but you see no signs of it on his face. The warriors nod at him, honoring him, as he leaves the room to prepare.";
	text3 = "The arena awaits.";
	action = END_TALK;
	code =
		sf(28,24,1);
		sf(28,19,1);
		erase_char(2850);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = 1;
	question = "_That is all._";
	text1 = "He nods and silently returns to his work.";
	action = END_TALK;
	
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "At last, you have found the ghosts. They line the benches to either side, watching you as you enter. They are the dead rebels of the Rokaj, fading away here for a century. They are too weak and faded to do any harm.";
	text2 = "There is one shade here that retains some of the power he had in life. He stands behind a pile of skulls. There is another shade behind him, wearing robes and a hood. It whispers something to him and then fades away.";
	text3 = "The Lithan ghost points its spectral scourge at you. _Haven has returned! At last, we can have our revenge!_";
	code =
		set_dialogue_pic(853); // 
	break;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_And who were you, exactly?_";
	text1 = "_We are the dead of the Great Uprising. We fought against you once. You laid siege to Hraxamus and destroyed it, and us. Now we can fight again at last!_";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_Nice skulls._";
	text1 = "_They were our heads in life. They will witness our triumph!_";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_Did you know that I'm a [P]?_";
	text1 = "The shades quiver and whisper to each other. This news is very exciting. _Truly, this will be a glorious revenge!_";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_I do not wish to fight you._";
	text1 = "_We did not wish to fight you! We only wanted our freedom! You brought a fight to us. Now we return it to you!_";
	text2 = "He picks up the horn behind him and, surprisingly, is able to blow it. As the echo of its call fades, you hear other sounds.";
	
begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_You received your just punishment, rebel. I accept your challenge._";
	text1 = "_Yes! That is what we expected! Truly, this will be a glorious revenge!_";
	text2 = "He picks up the horn behind him and, surprisingly, is able to blow it. As the echo of its call fades, you hear other sounds.";

begintalknode;
	state = 41;
	nextstate = -1;
	condition = 1;
	question = "Listen.";
	text1 = "The tower is now alive with scraping and moaning. All of the bones you passed on the way in are coming together and rising. The army of the dead has trapped you in their tower.";
	text2 = "It is time to lay them to their final rest.";
	action = END_TALK;
	code =
		erase_char(30001);
		set_attitude(2800,10);
		activate_hidden_group(1);
		sf(28,13,1);
	break;
	
	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				